package learn_concurrent._1;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class T15 {
	final static Logger logger = LoggerFactory.getLogger(T15.class);

	public static void main(String[] args) {
		test1();
	}

	private static void test1() {
		logger.debug("start...");
		Thread t1 = new Thread(() -> {
			logger.debug("start......");
			while (true) {
				if(Thread.currentThread().isInterrupted()) {
					logger.debug("end......");
					break;
				}
			}
		});

		t1.start();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		t1.interrupt();
		logger.debug("end...");
	}

}
